home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
djgpp
/
go32
/
fs
/
io.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-21
|
6KB
|
148 lines
#ifndef FS_IO_H
#define FS_IO_H 1
/* --------------------- Additional key definitions --------------------- */
#define K_BackTab 0x10f
#define K_ELeft 0x24b
/* ------------------ Values to be used with open_win ------------------- */
#define single_border 1
#define double_border 2
/* -------------- Type definition to be used with text_win -------------- */
typedef char *ONE_LINE;
typedef struct {
ONE_LINE *page;
char *tittle;
int lines;
} WIN_TEXT;
/*--------------- Type definition to be used with dialog () ------------- */
typedef struct D_ITEM {
char *field_name;
word32 return_addr;
int input_length;
int editable;
void (*formatter)(char*, char*);
void (*evaluater)(void*, char*);
void (*initializer)(char*, char *, word32);
int (*editor)(char *, word32, int, int, int, int *);
} DIALOG_ITEM;
typedef struct B_ITEM {
char *name;
int stay;
int (*action)(DIALOG_ITEM dialog_data[]);
} BUTTON_ITEM;
/* --------------- Type definition to be used with menu () -------------- */
#define ITEM_TYPE 0
#define MENU_TYPE 1
typedef struct M_ITEM {
char *name;
int type;
char *hot_key; /* i.e. Hot STRING */
struct M_ITEM *child;
} MENU_ITEM;
/* ------------ Type definition to be used with parse_string () --------- */
#define INT_TYPE 0
#define STR_TYPE 1
typedef struct P_DEF {
char *sw;
int type;
union {
int *i_val;
char *s_val;
} val;
} PARSE_DEF;
/* ----------------------- Type definition for message () --------------- */
typedef enum { CL_Info, CL_Msg, CL_Error } CL_TYPE;
extern char *user_screen_save, *debug_screen_save;
extern unsigned char screen_attr;
extern unsigned char screen_attr_normal;
extern unsigned char screen_attr_source;
extern unsigned char screen_attr_focus;
extern unsigned char screen_attr_ffocus;
extern unsigned char screen_attr_break;
extern unsigned char screen_attr_message;
extern unsigned char screen_attr_error;
extern unsigned char screen_attr_resize;
extern unsigned char screen_attr_asm;
extern unsigned char screen_attr_help;
extern unsigned char screen_attr_addr;
extern unsigned char screen_attr_hot;
extern unsigned char st_ln_attr;
extern int cols, max_cols;
extern int rows, max_rows;
extern char *read_buffer;
extern char StatusLine[100];
/* ----------------------- Normal IO fuctions --------------------------- */
unsigned int getykey(void);
void put (int x, int y, unsigned char *txt);
void putl (int x, int y, int l, unsigned char *txt);
void clear_screen (void);
void draw (int x, int y, unsigned char ch, int delta, int count);
void highlight (int x, int y, int len);
void frame (int x1, int y1, int x2, int y2, char *tittle);
void double_frame (int x1, int y1, int x2, int y2, char *tittle);
void screen_scroll (int lines);
void put_screen (char *screen);
char *get_screen (void);
char *get_old_screen (void);
void restore_screen (char *saved);
void refresh (void);
int mysleep (int secs);
int short_sleep (unsigned long msecs);
void message (CL_TYPE class, char *fmt, ...);
int read_string (char *starttext);
int my_read_string(char *prompt);
int my_get_char(char *prompt);
int confirm (char *prompt);
/* ----------------------- Dialog routines ------------------------------ */
void format_addr (char *output, char *input);
void format_word (char *output, char *input);
void format_deci (char *output, char *input);
void format_int (char *output, char *input);
void format_asis (char *output, char *input);
void eval_word (void *output, char *input);
void eval_asis (void *output, char *input);
void init_addr (char *output, char *input, word32 addr);
void init_word (char *output, char *input, word32 addr);
void init_deci (char *output, char *input, word32 addr);
void init_int (char *output, char *input, word32 addr);
void init_asis (char *output, char *input, word32 addr);
int editor (char *text, word32 addr, int x, int y, int len, int *key);
int action_done (DIALOG_ITEM dialog_data[]);
void dialog (char *tittle,
DIALOG_ITEM dialog_data[], BUTTON_ITEM button_data[], int *ret);
/* ---------------------- Windows routines ------------------------------ */
char *open_win(int width, int height, int attribute, int border,
int *x_start, int *y_start, int *actual_width, char *tittle);
void close_win(char *saved);
void init_text (WIN_TEXT *text, char *tittle);
void add_text (WIN_TEXT *text, char *line);
void free_text (WIN_TEXT *text);
void text_win (WIN_TEXT text, int user_width, int user_height);
/* ----------------------- Menus routines ------------------------------- */
int display_bar_menu (MENU_ITEM menu_data[], int *pos);
int display_pop_menu (MENU_ITEM menu_data[], char *tittle,
int x_pos, int y_pos);
void menu (MENU_ITEM menu_data[], int *BarSelect, int *PopSelect);
void pop_menu (MENU_ITEM menu_data[], char *tittle, int x, int y,
int *PopSelect);
void show_menu_bar (MENU_ITEM menu_data[]);
/* --------------------------- Parse ------------------------------------ */
void parse_string (PARSE_DEF definition[], char *s);
/* --------------------------- Misc ------------------------------------- */
void write_log (int x1, int y1, int x2, int y2);
void read_log (void);
void read_write_log(int x1, int y1, int x2, int y2);
/* ------------------------- Initialize --------------------------------- */
void re_start_transfer (void);
void init_io (int com_port);
void re_init_io (int com_port, int new_rows, int new_cols);
void init_color (int color);
#endif